<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>SpringBoot 综合案例</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="margin: 35px;">
    <form class="form-horizontal" th:action="@{/all/user}" method="post" enctype="application/x-www-form-urlencoded">
        <input type="hidden" name="_method" value="put" th:if="${userInfo!=null}"/>
        <input type="hidden" name="id" th:if="${userInfo!=null}" th:value="${userInfo.id}">
        <div class="form-group">
            <label for="nick" class="col-sm-2 control-label">昵称</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="nick" name="nick" th:value="${userInfo == null ? '': userInfo.nick}"
                       placeholder="请输入昵称">
            </div>
        </div>

        <div class="form-group">
            <label for="phone" class="col-sm-2 control-label">手机号</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="phone" name="phone" th:value="${userInfo == null ? '': userInfo.phone}"
                placeholder="请输入手机号">
            </div>
        </div>

        <div class="form-group">
            <label for="email" class="col-sm-2 control-label">E-mail</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="email" name="email" th:value="${userInfo == null ? '': userInfo.email}"
                       placeholder="请输入email">
            </div>
        </div>

        <div class="form-group">
            <label for="address" class="col-sm-2 control-label">地址</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="address" name="address" th:value="${userInfo == null ? '': userInfo.address}"
                       placeholder="请输入地址">
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">添加</button>
            </div>
        </div>
    </form>
</body>
</html>